<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Demo21</title>
  <script src="js/vue.js"></script>
</head>
<body>
<div id="app"></div>
</body>
<script>
  const app=Vue.createApp({
    data(){
      return{}
    },
    methods:{
      handleKeyDown(){
        console.log('keydown....')
      },
      handleClick(){
        console.log('右键显示')
      }
    },
    template:`
        <div>
<!--        回车修饰   只有按回车，才触发事件
类似的还有不少：enter 、tab、delete、esc、up 、down、left、right-->
            <input @keydown.enter="handleKeyDown" />
<!--        鼠标事件 right left middle 关键字-->
        </div><div @click.right="handleClick">JSPang.com</div>
        `
  })
  const vm=app.mount("#app")

</script>

</html>
